package com.sjt.demo12;

import lombok.extern.slf4j.Slf4j;

import java.sql.Connection;
/*
测试类
 */
@Slf4j
public class test {
    public static void main(String[] args) {
       //初始5个连接
       ConnectionPool pool=new ConnectionPool(5);
        for (int i = 0; i <20 ; i++) {
            new Thread(()->{
                Connection connection = pool.getConnection();
                log.debug(String.valueOf(connection));
                pool.releaseConnection(connection);
            },"线程"+i).start();
        }
    }

}
